package edu.friday.utils;

import edu.friday.model.SysUser;
import org.springframework.security.core.context.SecurityContextHolder;

public class ClearUserUtils {
    public static SysUser getCurrentUser() {
        SysUser user = (SysUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return user;
    }

    public static void clearContext(){
        SecurityContextHolder.clearContext();
    }
}
